package com.xkcoding.dubbo.provider.filter;


import com.alibaba.dubbo.common.Constants;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.common.constants.CommonConstants;
import org.apache.dubbo.common.extension.Activate;
import org.apache.dubbo.rpc.*;


/**
 * @Author: dengkaibing
 * @Description: dubbo 过滤器
 * @Date: 2021/3/9 14:50
 * @company 翼支付
 */
@Slf4j
@Activate(group = CommonConstants.PROVIDER,order = -9000)
public class TimeStatisticsFilter implements Filter {

    /**
     *
     *
     * @param invoker 目标对象
     * @param invocation 参数类对象
     @return
     */
    @Override
    public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
        log.info("TimeStatisticsFilter 拦截器前：{}",invocation.getArguments());
        Result result=null;
        result=invoker.invoke(invocation);
        log.info("result:{}",result);
        log.info("TimeStatisticsFilter 调用后");
        return result;
    }

}
